package com.fm.openinstall.b;

import org.json.*;
import android.text.*;

public class a
{
    private String a;
    private String b;
    private int c;

    public static String a(final a a) {
        final JSONObject jsonObject = new JSONObject();
        Label_0025: {
            if (a != null) {
                break Label_0025;
            }
            int c = 0;
            try {
                while (true) {
                    jsonObject.put("pbType", c);
                    return jsonObject.toString();
                    jsonObject.put("pbText", (Object)a.a);
                    jsonObject.put("pbHtml", (Object)a.b);
                    c = a.c;
                    continue;
                }
            }
            catch (JSONException ex) {
                return jsonObject.toString();
            }
        }
    }

    public static a c(final String s) {
        if (TextUtils.isEmpty((CharSequence)s)) {
            return null;
        }
        final a a = new a();
        try {
            final JSONObject jsonObject = new JSONObject(s);
            if (jsonObject.has("pbText")) {
                a.a(jsonObject.optString("pbText"));
            }
            if (jsonObject.has("pbHtml")) {
                a.b(jsonObject.optString("pbHtml"));
            }
            if (jsonObject.has("pbType")) {
                a.a(jsonObject.optInt("pbType"));
            }
            return a;
        }
        catch (JSONException ex) {
            return null;
        }
    }

    public String a() {
        return this.a;
    }

    public void a(final int c) {
        this.c = c;
    }

    public void a(final String a) {
        this.a = a;
    }

    public String b() {
        return this.b;
    }

    public void b(final int n) {
        this.c |= n;
    }

    public void b(final String b) {
        this.b = b;
    }

    public int c() {
        return this.c;
    }

    public boolean c(final int n) {
        return (n & this.c) != 0x0;
    }
}
